﻿using RFBR.DataAccess;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RFBR.Core.Infrastructure.Models.Structure
{
	internal abstract class Entity : IEntity
	{

		#region [Private members]
		private Guid _id;
		private EntityType? _type;
		#endregion
		#region [Constructors]
		/// <summary>
		/// Создает сущность с заданными параметрами
		/// </summary>
		/// <param name="id"></param>
		/// <param name="name"></param>
		public Entity(Guid id, string name = "Unknown", EntityType type = EntityType.Custom)
		{
			_id = id;
			_type = type;
			Name = name;
		}
		#endregion
		#region [Properties]
		/// <summary>
		/// Id сущности
		/// </summary>
		public Guid Id
		{
			get
			{
				return _id;
			}
		}
		public string Name { get; set; }
		public EntityType Type
		{
			get
			{
				return _type ?? EntityType.Custom;
			}
		}
		#endregion
	}
}
